package day22;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * 输出字符串出现一次的第一个字符
 *
 * @author wileda
 * @date 2023/03/29  22:36
 */
public class Main {
        public static void main(String[] args) {
            Scanner scanner = new Scanner(System.in);
            while(scanner.hasNext()){
                String str = scanner.nextLine();
                System.out.println(countChar(str));
            }
        }

        public static String countChar(String str){
            if(str == null || str.equals("")){
                return "-1";
            }
            Map<Character,Integer> map = new HashMap<>();
            for(int i = 0;i < str.length(); i++){
                char ch = str.charAt(i);
                map.put(ch,map.getOrDefault(ch,0) + 1);
            }

            for(int i = 0; i < str.length(); i++){
                char ch = str.charAt(i);
                if(map.get(ch) == 1){
                    return String.valueOf(ch);
                }
            }
            return "-1";
        }
    }
